package xman.mstruts.controller;

import java.io.File;

import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Scope("prototype")
@Controller
public class CommonAction extends AbstractAction {
    private static final Logger logger = Logger.getLogger(CommonAction.class);
    
    private File file;
    
    public void upload() {
        String fileName = "";
        String contextPath = ServletActionContext.getServletContext().getRealPath("/");
        String fileLocation = contextPath + fileName;
        logger.info(fileLocation);
        File desFile = new File(fileLocation);
        writeFile(desFile);
        String url = "";
        output(url, callback);
    }
    
    public File getFile() {
        return file;
    }
    
    public void setFile(File file) {
        this.file = file;
    }
}
